<?php
session_start();
?>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>
        <?php
        // put your code here
        if(empty($_SESSION['cart1'])) $_SESSION['cart1']=array();
        $products=array();
        $products['B1']=array('name'=>'Lap trinh co ban','cost'=>'140');
        $products['B2']=array('name'=>'Thiet ke web','cost'=>'255');
        
        if(isset($_POST['action']))
        {
            $action=$_POST['action'];
        }
        else if(isset($_GET['action']))
        {
            $action=$_GET['action'];
        }
        else
        {
            $action='show_add_item';
        }
        
        switch($action)
        {
            case 'add':
                
                include 'cart_view.php';
                break;
            case 'update':
                
                include 'cart_view.php';
                break;
            case 'show_cart':
                
                include 'cart_view.php';
                break;
            case 'show_add_item':
                
                include 'add_item_view.php';
                break;
            case 'empty_cart':
                unset($_SESSION['cart1']);
                include 'cart_view.php';
                break;
        }
        ?>
    </body>
</html>
